package controllers

import (
    "volux/internal/models"
)

// BdevController 处理块设备相关请求
type BdevController struct {
    BaseController
}

// CreateBdev 创建块设备
// @router /bdevs [post]
func (c *BdevController) CreateBdev() {
    var bdev models.Bdev
    if err := c.ParseJSON(&bdev); err != nil {
        c.ErrorResponse(400, "Invalid request body")
        return
    }

    // 通过service层处理业务逻辑
    if err := c.bdevService.CreateBdev(&bdev); err != nil {
        c.ErrorResponse(500, err.Error())
        return
    }

    c.SuccessResponse(bdev)
}

// ...other methods...
